home *** CD-ROM | disk | FTP | other *** search
- function forward() {
- mail -f
- }
-
- function gethost() {
- shift 1
- set __hn = "$1"
- }
-
- function unset_vacation() {
- sh $ZMLIB/bin/unset_vac
- echo -d "Vacation program unset"
- }
-
- function set_vacation() {
- set __vmessage = $HOME/.vacation.msg
- set __vprogram = /usr/sbin/vacation
- set __reassembler = $ZMLIB/bin/reassembler
- set __interval = 7
- gethost $hostname
-
- # Validate that the vacation program exists.
- if ! -e $__vprogram
- error "Vacation program is not available"
- endif
-
- # Get interval in number of days for vacation message to be resent.
- ask -i __interval "Reply interval in days:" $__interval
- if $status == -1 # if user cancelled command, return now
- echo "Vacation command cancelled."
- return -1
- endif
-
- # If vacation message file does not exist, create one with appropriate
- # headers.
- if ! -e $__vmessage
- set __from = "From: $LOGNAME@$__hn ($realname)"
- set __subj = "Subject: I am on vacation"
- set __prec = "Precedence: bulk"
- set __mess = "I am out of the office..."
- sh "echo '$__from'\\n$__subj\\n$__prec\\n\\n$__mess > $__vmessage"
- endif
-
- sh jot -f $__vmessage
- sh $__vprogram -i -r $__interval
- sh $ZMLIB/bin/unset_vac
-
- if -e $HOME/.forward
- sh cp $HOME/.forward $HOME/.forward.reassembler
- endif
-
- if $?dot_forward
- sh echo '\|'$__reassembler, \"'\|'$__vprogram -a $LOGNAME@$__hn $LOGNAME\"> $HOME/.forward
- else
- sh echo $LOGNAME, \"'\|'$__vprogram -a $LOGNAME@$__hn $LOGNAME\"> /tmp/.forw$$
- sh "sed 's/\(.*\)/\\\1/' /tmp/.forw$$ > $HOME/.forward"
- sh rm -f /tmp/.forw$$
- endif
-
- sh touch $HOME/.vacation_set
-
- echo -d "Vacation program set"
-
- }
-
- function vacation() {
- if -e $HOME/.vacation_set
- set __vac_def = "Unset"
- set __vac_choices = "Set"
- else
- set __vac_def = "Set"
- set __vac_choices = "Unset"
- endif
-
- set __vac
- ask -i __vac -m -d $__vac_def "Select Set/Unset Vacation:" $__vac_choices
- if $status == -1 # if user cancelled command, return now
- echo "Vacation command cancelled."
- return -1
- endif
-
- if $__vac == "Set"
- set_vacation
- else
- unset_vacation
- endif
- }
-
- if -e /usr/lib/InPerson/inpinvite
- set __InPerson
- endif
-
- function zmenu_reply_inperson() {
- if $?[%?X-InPerson-Address?]
- set __ipaddr = "$[%?X-InPerson-Address?]"
- else
- set __ipaddr="$[%a]"
- endif
- sh /usr/lib/InPerson/inpinvite -to "$__ipaddr" -subject "$[%s]"
- }
-
- function print_options() {
- set __print_cmd=$print_cmd
- ask -m -d "Portrait" -i __action "Select Print Options:" "Portrait" "Landscape" "Two pages/sheet" "A4"
- if $status == 0
- if "x$__action" == "xPortrait"
- set print_cmd=$__print_cmd
- else
- if "x$__action" == "xLandscape"
- set print_cmd="mailp -W170 -p $MP_PROLOGUE/mp.pro.ls.ps %O"
- else
- if "x$__action" == "xTwo pages/sheet"
- set print_cmd="mailp -W80 -l %O"
- else
- if "x$__action" == "xA4"
- set print_cmd="mailp -A4 %O"
- endif
- endif
- endif
- endif
- lpr
- set print_cmd=$__print_cmd
- endif
- }
-